package me.stone.stanimeclient.page.recommend

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import androidx.paging.Pager
import androidx.paging.PagingConfig
import androidx.paging.cachedIn
import dagger.hilt.android.lifecycle.HiltViewModel
import me.stone.stanimeclient.core.data.domain.data.ListRecommendRepository
import javax.inject.Inject

@HiltViewModel
class RecommendViewModel @Inject constructor(
    private val repository: ListRecommendRepository
) : ViewModel() {

    val recommend = Pager(PagingConfig(1)) {
        RecommendPagingSource(repository)
    }.flow.cachedIn(viewModelScope)

}